package jeconbond.experiment.natural.prodpossibfrontier;

import jeconbond.economic.resources.IResourceType;
import jeconbond.experiment.natural.prodpossibfrontier.process.ConneryExperimentContext;
import jeconbond.experiment.BaseJEBExperimentSettings;
import jeconbond.Q.computation.IProgressFunc;
import jeconbond.Q.computation.ProdPossProgressFunc;
import laboratoryQ.experiment.settings.SettingsAnnotations.Hidden;

public class ConneryExperimentSettings extends BaseJEBExperimentSettings {
	public int agentPerStep = -1;
	public int branchesCount = -1;

	public double tankMul = -1.0;
	public double traktorMul = -1.0;
	public double relationBoard = -1.0;
	public double fluctuationPart = -1.0;
	public double relationDistPercent = -1.0;
	public double ironByStep = -1.0;
	
	public IResourceType ironResource = null;
	public IResourceType tankResource = null;
	public IResourceType traktorResource = null;
//	public int branchLength = -1;

	static { System.out.println("\nOLD_EXPERIMENT remove getGoalsArray(int steps, IProgressFunc progressFunc) from connery settings"); }
	@Hidden
	public double[] goalsArray;
	private static double[] genGoalsArray(int steps, IProgressFunc progressFunc) {
		double[] goalsArray = new double[steps];
		double[] tmp = new double[2];
		for (int i = 0; i < steps; i++) {
			progressFunc.compute(i / (double)steps, tmp);
			goalsArray[i] = tmp[0] / tmp[1];
		}
		return goalsArray;
	}
	public double[] getGoalsArray() {
		if (goalsArray == null || goalsArray.length == 0) {
			IProgressFunc progressFunc = new ProdPossProgressFunc(tankMul, traktorMul);
			goalsArray = genGoalsArray(stepCount, progressFunc);
		}
		return goalsArray;
	}
	
	public ConneryExperimentSettings() {
		experimentContextFactory = ConneryExperimentContext.FACTORY_INSTANCE;
	}
}
